package cn.zkrt.iotms.feign;


import cn.zkrt.iotms.comm.Constant;
import cn.zkrt.iotms.comm.R;
import cn.zkrt.iotms.config.FeignTokenSupportConfig;
import cn.zkrt.iotms.feign.model.ResouceBase64;
import cn.zkrt.iotms.feign.model.Resource;
import feign.Response;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@FeignClient(name = Constant.SERVICE_SFR_CODE,
        url = "${feignUrl.sfr}",
        configuration = FeignTokenSupportConfig.class)
public interface SfrClient {

    @GetMapping("/resourcer/download/{id}")
    Response downloadFile(@PathVariable("id") Long id);


    @PostMapping(value = "/resourcer/upload/base64")
    R<Resource> uploadFile(@RequestBody ResouceBase64 resouce);


}
